package ch.usi.inf.pf2.alu.nodes;

/**
 * This is an Identifier node, and implements the maximum function.
 * 
 * @author Thomas Mantegazzi
 * 
 */

public class MaxNode extends IdentifierNode {

	public MaxNode(Node[] arguments) {
		super(arguments);
	}

	protected double compute(double[] args) {
		double max = args[0];
		for (double d : args) {
			if (d > max) {
				max = d;
			} else {
			}
		}
		return max;
	}

}
